﻿namespace dPet.Infrastructure.EntityFramework.ModelConfigurations
{
	using dPet.Domain.Models;
	using Hangerd.EntityFramework;

	public class SaleOrderConfig : EntityTypeConfigBase<SaleOrder>
	{
		public SaleOrderConfig()
		{
			Property(so => so.OrderNumber)
				.IsRequired()
				.HasMaxLength(32);

			Property(so => so.HospitalId)
				.IsRequired()
				.HasMaxLength(32);

			HasMany(so => so.OrderLines)
				.WithRequired();

			Property(so => so.Creator)
				.HasMaxLength(50);

			Property(so => so.Completer)
				.HasMaxLength(50);
		}
	}
}
